{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style type="text/css">
.radius:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 span:hover{
 	color: #333;
 }
 .btn-primary {
    color: #fff;
    background-color: #409eff;
    border-color: #409eff;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
}
</style>
<body>
  <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
   
    财务管理
    <span class="c-gray en">&gt;</span>
    代理返佣记录

    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav>
  <div style="padding:20px;height:30px;">
    
    <div class="new_box">
  <div class="cl pd-5 bg-1 bk-gray mt-20" style="height: 40px;background-color: #e5e5e5 !important; border-bottom: 1px solid #e4e7ed">


    <span class="l">
      <a class="btn" data-title="返佣记录表" href="{:url('recharge/agentList')}" >手动返佣记录表</a>
      <span class="line">◆</span>
    </span>
    
    <span class="l">
      <a class="btn" data-title="返佣设置分组" href="{:url('recharge/agentSave')}" style="background:#636363;border-color: #636363;color: #fff;margin-left: -1px;">返佣设置分组</a>

    </span>
  
  </div>
  </div>
<div class="text-c" style="padding :20px 0;">
					    <!-- <form action="" enctype="application/x-www-form-urlencoded" method="get" style="margin-left:20px;float:left;">
                          
              <input type="text" name="ss_sql" id="ss_sql" value="{$user}" placeholder="用户名" style="width:150px;border-radius: 5px;" class="input-text">
               <button class="btn btn-success" type="submit" style="margin-right:20px;border-radius: 5px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
                           </form> -->
					   <form action="" enctype="application/x-www-form-urlencoded" method="get" style="margin-left:20px;float:left;">
             <input type="text" name="ss_sql" id="ss_sql" value="" placeholder="用户名" style="width:150px;border-radius: 5px;" class="input-text">
					   
					    <button class="btn btn-success" type="submit" style="margin-right:20px;border-radius: 5px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
					  </form>
					 
					 <!--  <form action="{:url('recharge/setopen')}" enctype="application/x-www-form-urlencoded" method="post" style="margin-left:20px;float:left;">
            
             <input type="radio" name="open" value="1" {if($open==1)}checked{/if}>自动
             <input type="radio" name="open" value="0" {if($open==0)}checked{/if}>手动
             <button class="btn btn-success" type="submit" style="margin-right:20px;border-radius: 5px;"><i class="Hui-iconfont">&#xe665;</i> 保存</button>
           </form> -->

	</div>
  
  <div class="page-container  dataTables_wrapper">
  
      <div id="tab-system" class="HuiTab">
      <form action="{:url('recharge/fysave')}" method="post" id="form">
        <div class="tabCon">
          <div class="mt-20">
            <table
              class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
              <thead>
                <tr class="text-c">
                <th><input type="checkbox" id="dj"></th>
                <th>代理名称</th>
                <th>返佣方式</th>
                </tr>
              </thead>
              <tbody>
              {volist name="us" id="item"}
                <tr class="text-c">
                  <td><input type="checkbox" value="{$item.id}-{$item.fystatus}" id="user" name="uid[]"></td>
                	<td>{$item.username}</td>
                	<td>{if($item.fystatus==1)}<span style="color:green;">自动</span>{else}<span style="color:blue;">手动</span>{/if}</td>
                
                </tr>
              {/volist}
              </tbody>
            </table>
          </div>
        </div>
          <!-- <div style="position: absolute;width:200px;height:200px;left:650px;bottom: 100px;background-color: #999">
          <label>请选择要设置的返佣方式</label>
            <select >
              <option value="0">手动</option>
              <option value="1">自动</option>
            </select>
          </div> -->
         <button class="btn btn-primary radius" type="button" onclick="button()">批量设置返佣方式</button>
         <input type="hidden" value="" id="fyfangshi_post" name="fyfangshi_post">
         </form>
      </div>
      <div class="dataTables_paginate paging_simple_numbers" style="width:100%;">
          <div style="float:left;">  
                  每页显示<select name="limit" style="height:26px;" id="code">
                      <option value="20" {if condition="$limit eq 20"}selected{/if}>
                        20
                      </option>
                      <option value="50" {if condition="$limit eq 50"}selected{/if}>
                        50
                      </option>
                      <option value="100" {if condition="$limit eq 100"}selected{/if}>
                        100
                      </option>
                      
                      
                   </select>条
                  </div>
            <span style="float:right;margin-left:-2px;">总共{$us->lastPage()}页  当前第{$us->currentPage()}页 ，共{$us->total()}条</span>
            <div style="float:left;">{$us->render()}</div>
    </div>
  </div>
  </div>
{/block}

{block name="js"}
  <script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
  <script type="text/javascript">
    function open_zhixing_4(id){
      var id=id;
      var statu=1;
      layer.open({
        title:"结算方式：",
        content:'<textarea id="tuibz" cols="35" rows="5" value=""></textarea><p style="color:red">请填写冻结原因</p>',
        yes: function(index, layero){
            var beizhu = $("#tuibz").val();
            window.location.href="/admin/member/frozen?uid="+id+"&beizhu="+beizhu+"&statu="+statu;
          }
        });
      }

    $(function() {
      $('.skin-minimal input').iCheck({
        checkboxClass : 'icheckbox-blue',
        radioClass : 'iradio-blue',
        increaseArea : '20%'
      });
      $("#tab-system").Huitab({
        index : 0
      });
    });
    $("#code").on('change',function(){
    var username=$("#ss_sql").val();
    var time1=$("#sDate1").val();
    var time2=$("#sDate2").val();
    var id = $(this).find('option:selected').val();
    var us=$("#usid").val();
    window.location.href="/admin/recharge/agentSave?ss_sql="+username+"&limit="+id+"&sDate1="+time1+"&sDate2="+time2+'&us='+us;
  })
    $("#dj").click(function(){
    if($("#dj").is(":checked")){
      $(".text-c tr td #user").prop("checked",true);
    }else{
      $(".text-c tr td #user").prop("checked",false);
    }
  })
    function button(){
      
      layer.open({
      title:'提示',
      type: 1,
      skin: 'layui-layer-rim', //加上边框
      area: ['420px', '240px'], //宽高
      content: '<div style="padding:30px 15px;"><label style="font-size:16px;">请选择要设置的返佣方式：</label>&nbsp;<select id="fyfangshi" name="fyfangshi" style="height:28px;font-size:16px;width:90px;"><option value="0">手动</option><option value="1">自动</option></select><div style="width:230px;height:200px;text-align:right;line-height:150px;"><button style="background-color:#409eff;width:80px;height:25px;" type="button" onclick="form_submit()">确认并提交</button></div></div>'
});
}
function form_submit(){
  var fyfangshi=$("#fyfangshi").val();
  var fyfangshi_post=$("#fyfangshi_post").val(fyfangshi);
  $("#form").submit();
}
</script>

{/block}
